/*
 * @lc app=leetcode.cn id=2278 lang=typescript
 *
 * [2278] 字母在字符串中的百分比
 */

// @lc code=start
function percentageLetter(s: string, letter: string): number {
    let count = 0;
    for (let i = 0; i < s.length; i++) {
        const element = s[i];
        if (element === letter) count++;
    }
    return Math.floor((count * 100) / s.length);
}
// @lc code=end
